﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OrganizationName.CodeGeneration;

namespace OrganizationName.Factory
{
    public class Key : CollectionMaterial
    {
        public override System.Type GetConcreteType(ICodeContext codeContext)
        {
            if (!string.IsNullOrEmpty(Impl))
            {
                return base.GetConcreteType(codeContext);
            }
            else
            {
                return base.GetCollectionKeyType(codeContext);
            }
        }

        protected override System.Type GetCollectionType(ICodeContext codeContext)
        {
            return (codeContext.ParentContext.ParentContext.CodeProvider as GenericMaterial).GetConcreteType(codeContext.ParentContext.ParentContext);
        }
    }
}
